<template>
  <nut-popup :visible="props.show" :position="position" :round="round" :closeable="closeable" :overlay="overlay"
             z-index="999" @click-close-icon="clickClose"  @update:visible="updateShow">
    <slot></slot>
  </nut-popup>
</template>
<script setup>
import {defineProps, defineEmits} from "vue";

const props = defineProps({
  show: {
    type: Boolean,
    default: false
  },
  // 弹出层展示的位置
  position: {
    type: String,
    default: 'bottom'
  },
  // 是否显示圆角
  round: {
    type: Boolean,
    default: true
  },
  // 是否显示关闭按钮
  closeable: {
    type: Boolean,
    default: false
  },
  // 是否显示遮罩
  overlay: {
    type: Boolean,
    default: true
  }
})

const emit = defineEmits(['update:show']);

const clickClose = () => {
  emit("update:show", false);
}

const updateShow = (value) => {
  emit("update:show", value);
};
</script>
<style scoped lang="scss">

</style>